// 提示信息
function find(){
	var gameId = $("#gameId").val();
	$.ajax({
		type: "post",
		url: "/shareGame/select",
		data:{gameId:gameId},
		dataType:"json",
		async:false,
		success: function(data) {
			if (data.ROW_ID == -1) {
				$("#shareContext").text("");
				$("#rowId").val(null);
			} else {
				$("#shareContext").text(data.SHARE_CONTEXT);
				$("#rowId").val(data.ROW_ID);
			}
		}
	});
}
function add() {
	var gameId = $("#gameId").val();
	if (!CheckUtil.isNotNull(gameId)) {
		layer.msg("请选择游戏!");
		return;
	}
	var shareContext = $("#shareContext").val();
	if (!CheckUtil.isNotNull(shareContext)) {
		layer.msg("请输入分享规则!");
		return;
	}
	var rand_n_ = $('input[name="rand_n_"]').val();
	var randAttribute_v_ = $('input[name="randAttribute_v_"]').val();
	var rowId = $("#rowId").val();
	if ($("#isReCommit").val() == 0) {
		$("#isReCommit").val(1);
		$.ajax({
			type: "post",
			url: "/shareGame/save",
			async:false,
			data:{shareContext:shareContext, gameId:gameId, rowId:rowId, rand_n_:rand_n_, randAttribute_v_:randAttribute_v_},
			success: function() {
				layer.msg("分享规则设置成功");
				setTimeout("window.location.reload();",500);
			}
		});
	}
}